package org.common.repository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;
import org.common.entity.UserEntity;

import java.util.List;

public interface UserRepository extends MongoRepository<UserEntity, String>{

    @Query("{'username': '?0'}")
    List<UserEntity> findByUsername(String username);


    @Query("{'username': '?0', 'password': '?1'}")
    List<UserEntity> findByUsernameAndPassword(String username, String password);
}
